(tool-bar-local-item-from-menu): Handle both cases: when the menu item
authorRichard M. Stallman <rms@gnu.org>
Sun, 5 May 2002 03:06:51 +0000 (03:06 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 5 May 2002 03:06:51 +0000 (03:06 +0000)
has cached info and when it doesn't.

lisp/toolbar/tool-bar.el

index ab11bc8b4506538b2bc2cf193621f53e8ca1aca9..42adca58a95cbcadd0af3b855e212a98eb35d40b 100644 (file)
@@ -208,8 +208,13 @@ MAP must contain appropriate binding for `[menu-bar]' which holds a keymap."
              (append (cdr defn) (list :image image) props))
          (setq defn (cdr defn))
          (define-key-after in-map (vector key)
-           (append `(menu-item ,(car defn) ,(cdr defn))
-                   (list :image image) props)))))))
+           (let ((rest (cdr defn)))
+             ;; If the rest of the definition starts
+             ;; with a list of menu cache info, get rid of that.
+             (if (and (consp rest) (consp (car rest)))
+                 (setq rest (cdr rest)))
+             (append `(menu-item ,(car defn) ,rest)
+                     (list :image image) props))))))))
 
 ;;; Set up some global items.  Additions/deletions up for grabs.